stopPieces = #("road165","road166","road138")

unhide (for obj in objects where obj.ishidden collect obj)

for roadname in stopPieces do
(
	execute ("selectmore $"+ roadname + "*")
)

max select invert
delete $

/*
--don't need this area anymore since I realized only a small number of sections have actual stop zones, intersections don't count since you don't necessarily have to stop
select $*
actionMan.executeAction 0 "40141"--ungroup everything

objList = getCurrentSelection()
for obj in objList do
(
	if (findItem stopPieces obj.name) == 0 do
	(
		if((obj.max.x - obj.min.x) > 5000 and (obj.max.y - obj.min.y) > 5000) then
			obj.name = "road292"
		else
			delete obj
	)
)
*/
select $*
objList = getCurrentSelection()
for obj in $ do
(
	newFaceSel = #{} --empty bitarray
	ConvertTo obj Editable_Poly

	for f = 1 to obj.numfaces where(obj.parent == undefined) do
	(
		temp =polyop.getFaceMatID obj f		
		if temp != undefined and temp != 1 and temp != 2 and temp !=4 do
		(
			append newFaceSel f
		)
	)
	polyop.deleteFaces obj newFaceSel
)




theMat = multiMaterial numsubs:2


black_color = standard()
black_color.diffuse = color 0 0 0 0
black_color.selfIllumAmount = 0.0

white_color = standard()
white_color.diffuse = color 255 255 255 255

black_color_id = 1
white_color_id = 2

theMat[black_color_id] = black_color
theMat[white_color_id] = white_color

--stopPieces = #("road165","road166","road138")
	white_pieces = #(
	 #{5, 11, 14, 16},
	#{2, 4},
	#{2, 4, 6..7, 9, 12}
	)
	
	
	for obj in Geometry do
	(
		index = findItem stopPieces obj.name

		for f = 1 to obj.numfaces do
		(
			polyop.setFaceMatID obj f black_color_id
		)
		polyop.setFaceMatID obj white_pieces[index] white_color_id
		obj.material = theMat
	)
